<?php

	/**
	 * This file will load the required header, content and footer files.
	 */
 	
	if ($theme_type == 'admin') {
		
		// Administration theme.
		// So we're loading from the 'admin' area.
		$theme = 'admin/' . $theme_alias;
		
		// This is for the header file to read the CSS correctly.
		$vars['layout'] = VIEWS . '/' . $theme . '/layout';
		
		// If we don't have a $page variable, default it to 'content.php'.
		if (!isset($page)) $page = 'content';
		
		// Load the header
		$this->load->view($theme. '/layout/header.php', $vars);
		
		// If we have a left side bar, load it.
		if (file_exists(APPPATH . '/views/' . $theme . '/layout/left-bar.php')) {
			$this->load->view($theme . '/layout/left-bar.php');
		}
		
		// Load content from given module.
		$this->load->view($theme . '/' . $module . '/' . $page . '.php');
		
		// If we have a right side bar, load it.
		if (file_exists(VIEWS . '/' . $theme . '/layout/right-bar.php')) {
			$this->load->view($theme . '/layout/right-bar.php');
		}
		
		// Load the footer.
		$this->load->view($theme . '/layout/footer.php');
		
	} 
	
	else {
		
		// Front-end theme.
		
	}


?>